/****************************************************************************
 * Elisa 1.0                                                                *
 *--------------------------------------------------------------------------*
 * Author: Laurent Granvilliers, Vincent Sorin                              *
 * Copyright (c) 2004 Laboratoire d'Informatique de Nantes Atlantique       *
 *--------------------------------------------------------------------------*
 * Elisa is distributed WITHOUT ANY WARRANTY. Read the associated           *
 * COPYRIGHT file for more details.                                         *
 *--------------------------------------------------------------------------*
 * elisa_domain.h                                                           *
 ****************************************************************************/

/**
 * @file elisa_domain.h
 * @brief Base classes for domain expression.
 */

#ifndef _ELISA_DOMAIN_H
#define _ELISA_DOMAIN_H

#include "elisa_defs.h"

NAMESPACE_ELISA

/**
 * @ingroup Domain
 * @class Domain
 * @brief Domain for variable
 */
class Domain
{
public:
	/**
 	 * @brief Constructors
 	 */
	Domain() {}

	Domain(const Domain & d) {}

	/**
 	 * @brief Destructor
 	 */
	virtual ~Domain() {}

	/**
 	 * Print the value of the domain in a stream
 	 * @param os the output stream
 	 */
	virtual void print(std::ostream & os) const = 0;

	virtual bool isDifferent(const Domain & d) const = 0;

	virtual double getWidth() const = 0;
};

END_NAMESPACE_ELISA


inline std::ostream &
operator<<(std::ostream& os, const elisa::Domain& d)
{
	d.print(os);
	return os;
}

inline bool operator!=(const elisa::Domain& d1, const elisa::Domain& d2)
{
	return d1.isDifferent(d2);
}

#endif // _ELISA_DOMAIN_H
